Skip to content

test(support): key bundle cache by source tree hash rather than pid - #13

Merged
SMOSTAFAH1 merged 2 commits into
developfrom
test/bundle-cache-source-hash
Nov 22, 2026
Merged

SMOSTAFAH1 merged 2 commits into
developfrom
test/bundle-cache-source-hash

Conversation

@SMOSTAFAH1

@SMOSTAFAH1 SMOSTAFAH1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Key the esbuild bundle cache by a SHA-256 hash of the source tree instead of process.pid. Ensures test workers, Docker environments, and deadline workers share valid bundles across processes, and invalidates the cache immediately when any TypeScript source file changes.

Changes included:

  • tests/support/loadMarkengine.cjs: Key cache files by 16-character source tree SHA-256 hash instead of process.pid.
  • bench/html-subset-render.cjs: Query bundle path dynamically via bundleToDisk() in bundleEvidence() instead of expecting a hardcoded pid-based path.
  • tests/bundle-cache.test.cjs: Add regression tests asserting hash-keyed output and cross-call consistency.

Key the esbuild bundle cache by a SHA-256 hash of the source tree instead of process.pid. Ensures test workers, Docker environments, and deadline workers share valid bundles across processes, and invalidates the cache immediately when any TypeScript source file changes.
Use bundleToDisk() to query the active cache bundle instead of constructing a pid-based path, matching the source-tree hashed cache scheme.
@sonarqubecloud

Copy link
Copy Markdown

@SMOSTAFAH1
SMOSTAFAH1 merged commit b3d8922 into develop Nov 22, 2026
4 checks passed
@SMOSTAFAH1
SMOSTAFAH1 deleted the test/bundle-cache-source-hash branch November 22, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(support): the bundle cache is keyed by pid, so workers and docker runs reuse a stale bundle

1 participant